package com.meixiang.entity.shopping.result;

import android.os.Parcel;
import android.os.Parcelable;

import com.meixiang.entity.shopping.SpecTagEntity;
import com.meixiang.entity.shopping.SpecTagGoodsEntity;

import java.util.List;

/**
 * 商品规格Result
 *
 * @author LZRUI
 */
public class SpecTagResult implements Parcelable {

    private String goodsId; // 商品id
    private String storeId; // 店铺id
    private String storeName; // 店铺名称
    private SpecTagGoodsEntity goods; // 商品信息
    private List<SpecTagEntity> specList; // 规格列表

    public SpecTagResult(String goodsId, String storeId, String storeName, SpecTagGoodsEntity goods, List<SpecTagEntity> specList) {
        this.goodsId = goodsId;
        this.storeId = storeId;
        this.storeName = storeName;
        this.goods = goods;
        this.specList = specList;
    }

    public SpecTagResult() {
    }

    public String getGoodsId() {
        return goodsId == null ? "" : goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public SpecTagGoodsEntity getGoods() {
        return goods;
    }

    public void setGoods(SpecTagGoodsEntity goods) {
        this.goods = goods;
    }

    public List<SpecTagEntity> getSpecList() {
        return specList;
    }

    public void setSpecList(List<SpecTagEntity> specList) {
        this.specList = specList;
    }

    public String getStoreId() {
        return storeId == null ? "" : storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getStoreName() {
        return storeName == null ? "" : storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.goodsId);
        dest.writeString(this.storeId);
        dest.writeString(this.storeName);
        dest.writeParcelable(this.goods, flags);
        dest.writeTypedList(this.specList);
    }

    protected SpecTagResult(Parcel in) {
        this.goodsId = in.readString();
        this.storeId = in.readString();
        this.storeName = in.readString();
        this.goods = in.readParcelable(SpecTagGoodsEntity.class.getClassLoader());
        this.specList = in.createTypedArrayList(SpecTagEntity.CREATOR);
    }

    public static final Creator<SpecTagResult> CREATOR = new Creator<SpecTagResult>() {
        @Override
        public SpecTagResult createFromParcel(Parcel source) {
            return new SpecTagResult(source);
        }

        @Override
        public SpecTagResult[] newArray(int size) {
            return new SpecTagResult[size];
        }
    };
}
